package com.gitee.zeric.codec.generaters;

import com.alibaba.fastjson.JSONObject;
import com.gitee.zeric.codec.util.IdGenerator;
import lombok.extern.slf4j.Slf4j;

/**
 * @author zj
 * @date 2021/12/14
 * 雪花id生成
 */
@Slf4j
public class UidGenerater extends AbstractCodeGerator {

    @Override
    public String generate(String ruleCode,JSONObject param)  {
        return String.valueOf(new IdGenerator().nextId());
    }

    @Override
    protected String[] fields() {
        return new String[0];
    }

    @Override
    public int size(JSONObject paramJson) {
        return 19;
    }
}
